import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '日期',
  //   align: 'center',
  //   dataIndex: 'createTime',
  //   width: 100,
  //   resizable: true,
  // },
  {
    title: '卡券库存',
    align: 'center',
    dataIndex: 'cardInventory',
    width: 80,
    resizable: true,
  },
  {
    title: '闲管家待结算',
    align: 'center',
    dataIndex: 'goodfishInventory',
    width: 80,
    resizable: true,
  },

  {
    title: '代付库存',
    align: 'center',
    dataIndex: 'payInventory',
    width: 80,
    resizable: true,
  },

  {
    title: '总和',
    align: 'center',
    dataIndex: 'sum',
    width: 80,
    resizable: true,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  // {
  //   field: 'createTime',
  //   label: '日期',
  //   component: 'RangePicker',
  //   componentProps: {
  //     valueFormat: 'YYYY-MM-DD',
  //   },
  // },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '会员-总数',
    field: 'memberTotal',
    component: 'InputNumber',
  },
  {
    label: '会员-新增',
    field: 'memberAdd',
    component: 'InputNumber',
  },
  {
    label: '会员-提现',
    field: 'memberWithdraw',
    component: 'InputNumber',
  },
  {
    label: '卡券-出单数',
    field: 'cardTotal',
    component: 'InputNumber',
  },
  {
    label: '卡券-添加好友数',
    field: 'cardAddMember',
    component: 'InputNumber',
  },
  {
    label: '卡券-入库券数',
    field: 'cardAdd',
    component: 'InputNumber',
  },
  {
    label: '卡券-失效数',
    field: 'cardLose',
    component: 'InputNumber',
  },
  {
    label: '卡券-消耗数',
    field: 'cardUse',
    component: 'InputNumber',
  },
  {
    label: '卡券-营业额',
    field: 'cardTurnover',
    component: 'InputNumber',
  },
  {
    label: '卡券-利润',
    field: 'cardProfit',
    component: 'InputNumber',
  },
  {
    label: '代付-出单数',
    field: 'behalfTotal',
    component: 'InputNumber',
  },
  {
    label: '代付-添加好友数',
    field: 'behalfAddMember',
    component: 'InputNumber',
  },
  {
    label: '代付-营业额',
    field: 'behalfTurnover',
    component: 'InputNumber',
  },
  {
    label: '代付-利润',
    field: 'behalfProfit',
    component: 'InputNumber',
  },
  {
    label: '补贴',
    field: 'subsidy',
    component: 'InputNumber',
  },
  {
    label: '平台奖励',
    field: 'rewards',
    component: 'InputNumber',
  },
  {
    label: '总利润',
    field: 'totalProfit',
    component: 'InputNumber',
  },
  {
    label: '结算金额',
    field: 'totalAmount',
    component: 'InputNumber',
  },
  {
    label: '卖家会员名',
    field: 'sellerName',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  memberTotal: { title: '会员-总数', order: 0, view: 'number', type: 'number' },
  memberAdd: { title: '会员-新增', order: 1, view: 'number', type: 'number' },
  memberWithdraw: { title: '会员-提现', order: 2, view: 'number', type: 'number' },
  cardTotal: { title: '卡券-出单数', order: 3, view: 'number', type: 'number' },
  cardAddMember: { title: '卡券-添加好友数', order: 4, view: 'number', type: 'number' },
  cardAdd: { title: '卡券-入库券数', order: 5, view: 'number', type: 'number' },
  cardLose: { title: '卡券-失效数', order: 6, view: 'number', type: 'number' },
  cardUse: { title: '卡券-消耗数', order: 7, view: 'number', type: 'number' },
  cardTurnover: { title: '卡券-营业额', order: 8, view: 'number', type: 'number' },
  cardProfit: { title: '卡券-利润', order: 9, view: 'number', type: 'number' },
  behalfTotal: { title: '代付-出单数', order: 10, view: 'number', type: 'number' },
  behalfAddMember: { title: '代付-添加好友数', order: 11, view: 'number', type: 'number' },
  behalfTurnover: { title: '代付-营业额', order: 12, view: 'number', type: 'number' },
  behalfProfit: { title: '代付-利润', order: 13, view: 'number', type: 'number' },
  subsidy: { title: '补贴', order: 14, view: 'number', type: 'number' },
  rewards: { title: '平台奖励', order: 15, view: 'number', type: 'number' },
  totalProfit: { title: '总利润', order: 16, view: 'number', type: 'number' },
  totalAmount: { title: '结算金额', order: 17, view: 'number', type: 'number' },
  sellerName: { title: '卖家会员名', order: 18, view: 'text', type: 'string' },
};

/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
